package com.kuang.service;

import com.kuang.dao.CodeMapper;
import com.kuang.pojo.Code;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CodeServiceImpl implements CodeService {

    //service 调用dao
    @Autowired
    private CodeMapper CodeMapper;

    public void setCodeMapper(com.kuang.dao.CodeMapper codeMapper) {
        CodeMapper = codeMapper;
    }

    public List ListDay() {
        List list =CodeMapper.ListOptions("DAY");
        return list;
    }
    public List<Code> ListPlace(){
        List list =CodeMapper.ListOptions("PLACE");
        return list;
    }
    public List<Code> ListTime(){
        List list =CodeMapper.ListOptions("TIME");
        return list;
    }

    public int getNum(String bmcontent) {
        return CodeMapper.getPositionByContent(bmcontent);
    }

}
